package com.tmc.constant;

public class TaskConstant {

	public enum TaskStatus {

		WAITING("WAITING", "待执行"),
		SUCCESS("SUCCESS", "执行成功"),
		FAIL("FAIL", "执行失败"),
		DEAD("DEAD", "已过期");

		private String status;
		private String statusName;
		
		TaskStatus (String status, String statusName){
			this.status = status;
			this.statusName = statusName;
		}

		public String getStatus() {
			return status;
		}

		public void setStatus(String status) {
			this.status = status;
		}

		public String getStatusName() {
			return statusName;
		}

		public void setStatusName(String statusName) {
			this.statusName = statusName;
		}

	}
	
	public static String getTaskStatusName(String status){
		for (TaskStatus value : TaskStatus.values()){
			if (value.getStatus().equals(status)){
				return value.getStatusName();
			}
		}
		return "";
	}
	
}
